//
//  CYZiXunXiangGuanXiangMuTableViewCell.m
//  cyydt
//
//  Created by chu on 2019/1/23.
//  Copyright © 2019 chu. All rights reserved.
//

#import "CYZiXunXiangGuanXiangMuTableViewCell.h"
#import "ZTResourceViewController.h"
@implementation CYZiXunXiangGuanXiangMuTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setModel:(CYProjectModel *)model{
    _model = model;
    self.titleLabel.text = model.brand;
    self.introLabel.text = model.title;
    self.jiamengLabel.text = [NSString stringWithFormat:@"%@人已加盟", model.gbooks];
    if ([model.funds isEqualToString:@"0"]) {
        self.moneyLabel.text = @"全部";
    }else if ([model.funds isEqualToString:@"10"]){
        self.moneyLabel.text = @"3万以下";
    }else if ([model.funds isEqualToString:@"15"]){
        self.moneyLabel.text = @"3-8万";
    }else if ([model.funds isEqualToString:@"5"]){
        self.moneyLabel.text = @"5-10万";
    }else if ([model.funds isEqualToString:@"6"]){
        self.moneyLabel.text = @"10-20万";
    }else if ([model.funds isEqualToString:@"11"]){
        self.moneyLabel.text = @"20万以上";
    }
    [self.headImageView sd_setImageWithURL:[NSURL URLWithString:model.logo_item] placeholderImage:[UIImage imageWithColor:[UIColor lightGrayColor] Size:self.headImageView.frame.size]];
    
    //标签
    [self.labelView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
    UIView *view = [[Tool sharedInstance] setSignView:model.mode andBackgroundColor:RGBOF(0xF5F7FB) andTitleColor:RGBOF(0x97A2B9) Height:20 andFont:[UIFont systemFontOfSize:12] andMargin_x:8 andMargin_y:8 andMaxWidth:kWindowW - 145];
    [self.labelView addSubview:view];
    self.labelViewHeightConstraint.constant = view.frame.size.height;
}

- (IBAction)zixunActon:(UIButton *)sender {
    //咨询
    CYChatViewController *chat = [[CYChatViewController alloc] init];
    chat.url = [NSString stringWithFormat:@"%@?device=ios",self.model.wsurl];
    [[AppDelegate sharedAppDelegate] pushViewController:chat];
}

@end
